package com.quectel.sdk.baidu.model.auth;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.quectel.util.common.JacksonUtils;
import lombok.Data;

import java.io.Serializable;

/**
 * @author zhangheng
 * @email nolan.zhang@quectel.com
 * @date 2023/5/11 17:32
 * @description new java file header...
 */
@Data
public class BaiduBCEAuthResp implements Serializable {

    @JsonProperty("error_code")
    private String errorCode;

    @JsonProperty("error_msg")
    private String errorMsg;

    @JsonProperty("refresh_token")
    private String refreshToken;

    @JsonProperty("expires_in")
    private String expiresIn;

    @JsonProperty("session_key")
    private String sessionKey;

    @JsonProperty("access_token")
    private String accessToken;

    @JsonProperty("scope")
    private String scope;

    @JsonProperty("session_secret")
    private String sessionSecret;

    public static void main(String[] args) {
        BaiduBCEAuthResp baiduBCEAuthResp = new BaiduBCEAuthResp();
        baiduBCEAuthResp.setErrorCode("code");
        baiduBCEAuthResp.setErrorMsg("msg");
        baiduBCEAuthResp.setRefreshToken("token");
        baiduBCEAuthResp.setExpiresIn("20112");
        baiduBCEAuthResp.setSessionKey("key");
        baiduBCEAuthResp.setAccessToken("token");
        baiduBCEAuthResp.setScope("scope");
        baiduBCEAuthResp.setSessionSecret("secret");

        System.out.println(JacksonUtils.toJsonString(baiduBCEAuthResp));

        BaiduBCEAuthResp parse = JacksonUtils.parse(JacksonUtils.toJsonString(baiduBCEAuthResp), BaiduBCEAuthResp.class);

        System.out.println(JacksonUtils.toJsonString(parse));
    }

}
